package com.xiaofei.controller;

import com.xiaofei.Tools.AliyunOsss;
import com.xiaofei.Tools.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class upload {
    /*
    上传文件
     */
    @PostMapping("/upload")
    public Result upload(MultipartFile file) throws Exception {
        System.out.println("上传文件");
        String url = AliyunOsss.upload(file.getBytes(), file.getOriginalFilename());
        return Result.success(url);
    }
}
